/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

/**
 *
 * @author mehdi
 */
@Entity
public class Module implements Serializable {
    @ManyToMany(mappedBy = "module")
    private List<Learner> learners;
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
      private Long Moid;
   
   private String Homo;
 
   private String Demo;

   private String Cumo;
  
   private String Uumo;
  
   private String Dumo;
   @ManyToOne
   private  Trainer train;
   
   @ManyToOne
   private Thematic them;
   
   @OneToMany(mappedBy="modu")
   private  List<Sequence> sequence;
   
   @OneToMany(mappedBy="modu")
   private List<AssessementL> assessementL;
   @OneToMany(mappedBy="modu")
   private  List<AssessmentQ> assessmentQ;
   @ManyToOne
   private  Trainer trainer;

    public Module() {
    }
    public Module(String homo, String demo, Thematic them) {
    	super();
    	Homo = homo;
    	Demo = demo;
    	this.them = them;
    }


    public Module(Long moid, String homo, String demo, Thematic them) {
		super();
		Moid = moid;
		Homo = homo;
		Demo = demo;
		this.them = them;
	}
	public Long getMoid() {
		return Moid;
	}
	public void setMoid(Long moid) {
		Moid = moid;
	}
	public Thematic getThem() {
        return them;
    }

    public void setThem(Thematic them) {
        this.them = them;
    }

    public Trainer getTrain() {
        return train;
    }

    public void setTrain(Trainer train) {
        this.train = train;
    }


    public Long getId() {
        return Moid;
    }

    public void setId(Long id) {
        this.Moid = id;
    }

    public String getCumo() {
        return Cumo;
    }

    public void setCumo(String Cumo) {
        this.Cumo = Cumo;
    }

    public String getDemo() {
        return Demo;
    }

    public void setDemo(String Demo) {
        this.Demo = Demo;
    }

    public String getDumo() {
        return Dumo;
    }

    public void setDumo(String Dumo) {
        this.Dumo = Dumo;
    }

    public String getHomo() {
        return Homo;
    }

    public void setHomo(String Homo) {
        this.Homo = Homo;
    }

    public String getUumo() {
        return Uumo;
    }

    public void setUumo(String Uumo) {
        this.Uumo = Uumo;
    }

    public List<AssessementL> getAssessementL() {
        return assessementL;
    }

    public void setAssessementL(List<AssessementL> assessementL) {
        this.assessementL = assessementL;
    }

    public List<AssessmentQ> getAssessmentQ() {
        return assessmentQ;
    }

    public void setAssessmentQ(List<AssessmentQ> assessmentQ) {
        this.assessmentQ = assessmentQ;
    }

    public Trainer getTrainer() {
        return trainer;
    }

    public void setTrainer(Trainer trainer) {
        this.trainer = trainer;
    }
   
    public List<Learner> getLearners() {
        return learners;
    }

    public void setLearners(List<Learner> learners) {
        this.learners = learners;
    }

    public Collection<Sequence> getSequence() {
        return sequence;
    }

    public void setSequence(List<Sequence> sequence) {
        this.sequence = sequence;
    }

   
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (Moid != null ? Moid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Module)) {
            return false;
        }
        Module other = (Module) object;
        if ((this.Moid == null && other.Moid != null) || (this.Moid != null && !this.Moid.equals(other.Moid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "model.Module[ id=" + Moid + " ]";
    }
    
}
